package gew.data;

import java.text.NumberFormat;

public class TradeSummaryItemDetail {
    private final static String USD = "$ ";
    private final static String PERCENT = " %";
    
    private final String url;
    private final Integer share;
    private final String name;
    private final Long value;
    private final String color;
    private final String code;
    private boolean isMore = false;
    private final String shareStr;
    private final String valueStr;

    public TradeSummaryItemDetail(String url, String share, String name, String value, String color, String code, NumberFormat numberFormat, NumberFormat percentFormat) {
        this.url = url;        
        this.share = Integer.parseInt(share);
        this.name = name;
        this.value = Long.parseLong(value);
        this.color = color;
        this.code = code;
        this.shareStr = percentFormat.format(this.share*0.01).concat(PERCENT);
        this.valueStr = USD.concat(numberFormat.format(this.value));
    }

    public TradeSummaryItemDetail(String url, Integer share, String name, Long value, String color, String code, boolean isMore, NumberFormat numberFormat, NumberFormat percentFormat) {
        this.url = url;        
        this.share = share;
        this.name = name;
        this.value = value;
        this.color = color;
        this.code = code;
        this.isMore = isMore;
        this.shareStr = percentFormat.format(this.share*0.01).concat(PERCENT);
        this.valueStr = USD.concat(numberFormat.format(this.value));
    }

    public String getUrl() {
        return url;
    }

    public Integer getShare() {
        return share;
    }

    public String getName() {
        return name;
    }

    public Long getValue() {
        return value;
    }

    public String getColor() {
        return color;
    }

    public String getCode() {
        return code;
    }
    
    public boolean isMore(){
        return isMore;
    }

    public String getShareStr() {
        return shareStr;
    }

    public String getValueStr() {
        return valueStr;
    }
    
    
}
